<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="java.util.List" %>
<%@ page import="org.sample.sss.pojo.Resume" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Resume> resumes = (List<Resume>)request.getAttribute("resumes");
%>
<html>
<head>
    <title>list page</title>
    <script language="JavaScript">
        function add(){
            window.location.href="/add.jsp";
        }

        function update(id){
            window.location.href="/resume/toUpdate?id=" + id;
        }


        function del(id){
            window.location.href="/resume/delete?id=" + id;
        }

    </script>
</head>
<body>
<table>
    <thead>
    <tr>
        <td>ID</td>
        <td>姓名</td>
        <td>电话</td>
        <td>地址</td>
        <td colspan="2"><a href="javascript:void(0)" onclick="add()"/>增加</td>
    </tr>
    </thead>
    <%
        for(Resume resume : resumes){
    %>
    <tr>
        <td><%=resume.getId()%></td>
        <td><%=resume.getName()%></td>
        <td><%=resume.getPhone()%></td>
        <td><%=resume.getAddress()%></td>
        <td><a href="javascript:void(0)" onclick="update(<%=resume.getId()%>)">修改</a></td>
        <td><a href="javascript:void(0)" onclick="del(<%=resume.getId()%>)">删除</a></td>
    </tr>
    <%
        }
    %>
</table>
</body>
</html>